<!DOCTYPE HTML>
<html lang="en" >
    <!-- Start book 我的电子书 -->
    <head>
        <!-- head:start -->
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>选择器 | 我的电子书</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.9">
        <meta name="author" content="Melon">
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-toggle-chapters/toggle.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-image-captions/image-captions.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="../../md/02css/element_center.html" />
    
    
    <link rel="prev" href="../../md/02css/index.html" />
    

        <!-- head:end -->
    </head>
    <body>
        <!-- body:start -->
        
    <div class="book"
        data-level="2.1"
        data-chapter-title="选择器"
        data-filepath="md/02css/01selector.md"
        data-basepath="../.."
        data-revision="Mon Jun 08 2020 19:44:34 GMT+0800 (中国标准时间)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        Introduction
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="md/01html/01label.html">
            
                
                    <a href="../../md/01html/01label.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        HTML标签
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="md/01html/boxmodel.html">
            
                
                    <a href="../../md/01html/boxmodel.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        盒子模型
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="md/01html/nvmgitbook.html">
            
                
                    <a href="../../md/01html/nvmgitbook.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.</b>
                        
                        nvm和gitbook
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2" data-path="md/02css/index.html">
            
                
                    <a href="../../md/02css/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        css
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="2.1" data-path="md/02css/01selector.html">
            
                
                    <a href="../../md/02css/01selector.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="md/02css/element_center.html">
            
                
                    <a href="../../md/02css/element_center.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        元素垂直居中的方法
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="md/02css/Interview.html">
            
                
                    <a href="../../md/02css/Interview.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        面试题
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="md/02css/displayvisibility.html">
            
                
                    <a href="../../md/02css/displayvisibility.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.</b>
                        
                        元素的显示模式
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.5" data-path="md/02css/float.html">
            
                
                    <a href="../../md/02css/float.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.5.</b>
                        
                        浮动
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.6" data-path="md/02css/media.html">
            
                
                    <a href="../../md/02css/media.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.6.</b>
                        
                        media媒体查询
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.7" data-path="md/02css/position.html">
            
                
                    <a href="../../md/02css/position.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.7.</b>
                        
                        定位
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.8" data-path="md/02css/textoverflow.html">
            
                
                    <a href="../../md/02css/textoverflow.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.8.</b>
                        
                        文本溢出处理
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    Published with GitBook
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../../" >我的电子书</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="&#x9009;&#x62E9;&#x5668;">&#x9009;&#x62E9;&#x5668;</h1>
<h3 id="&#x901A;&#x914D;&#x7B26;">&#x901A;&#x914D;&#x7B26;</h3>
<ul>
<li>*</li>
</ul>
<h3 id="&#x7C7B;&#x9009;&#x62E9;&#x5668;">&#x7C7B;&#x9009;&#x62E9;&#x5668;</h3>
<ul>
<li>.class</li>
</ul>
<h3 id="id&#x9009;&#x62E9;&#x5668;">id&#x9009;&#x62E9;&#x5668;</h3>
<ul>
<li><h1 id="id">id</h1>
</li>
</ul>
<h3 id="&#x5143;&#x7D20;&#x9009;&#x62E9;&#x5668;">&#x5143;&#x7D20;&#x9009;&#x62E9;&#x5668;</h3>
<ul>
<li>p </li>
<li>ul</li>
</ul>
<h3 id="&#x5173;&#x7CFB;&#x9009;&#x62E9;&#x5668;">&#x5173;&#x7CFB;&#x9009;&#x62E9;&#x5668;</h3>
<ul>
<li>&#x5B50;&#x5B59;&#x9009;&#x62E9;&#x5668; <ul>
<li><code>A B</code> &#x9009;&#x62E9;&#x4E86;A&#x4E2D;&#x6240;&#x6709;B&#x7684;&#x5143;&#x7D20;</li>
</ul>
</li>
<li>&#x76F8;&#x90BB;&#x9009;&#x62E9;&#x5668; <ul>
<li><code>A+B</code> &#x9009;&#x62E9;A&#x76F8;&#x90BB;&#x7684;&#x5143;&#x7D20;</li>
</ul>
</li>
<li>&#x7236;&#x5B50;&#x9009;&#x62E9;&#x5668; <ul>
<li><code>A&gt;B</code> &#x9009;&#x62E9;A&#x4E2D;&#x5B50;&#x5143;&#x7D20;&#x6807;&#x7B7E;</li>
</ul>
</li>
<li>&#x5144;&#x5F1F;&#x9009;&#x62E9;&#x5668; <ul>
<li><code>A~B</code> &#x9009;&#x62E9;A&#x5F80;&#x4E0B;&#x65B9;&#x5411;&#x5E76;&#x5217;&#x7684;B&#x6807;&#x7B7E;</li>
</ul>
</li>
</ul>
<h3 id="&#x4F2A;&#x7C7B;&#x9009;&#x62E9;&#x5668;&#x5047;&#x7684;&#x7C7B;">&#x4F2A;&#x7C7B;&#x9009;&#x62E9;&#x5668;<code>&#x5047;&#x7684;&#x7C7B;</code></h3>
<ul>
<li><code>:hover</code> &#x5C06;&#x9F20;&#x6807;&#x60AC;&#x6D6E;&#x5728;&#x5143;&#x7D20;&#x4E0A;&#x65B9;&#x65F6;&#x5019;&#x51FA;&#x53D1;&#x5185;&#x5BB9;</li>
<li><code>:first-child</code> &#x7B2C;&#x4E00;&#x4E2A;&#x5143;&#x7D20;</li>
<li><code>:last-child</code> &#x6700;&#x540E;&#x4E00;&#x4E2A;&#x5143;&#x7D20;</li>
<li><code>:first-of-type</code> &#x540C;&#x7C7B;&#x578B;&#x5143;&#x7D20;&#x7684;&#x7B2C;&#x4E00;&#x4E2A;</li>
<li><code>:last-of-type</code> &#x540C;&#x7C7B;&#x578B;&#x5143;&#x7D20;&#x7684;&#x6700;&#x540E;&#x4E00;&#x4E2A;</li>
<li><code>:not()</code>--&#x62EC;&#x53F7;&#x91CC;&#x9762;&#x7684;&#x662F;&#x6392;&#x9664;&#x5728;&#x5916;&#x7684;&#xFF0C;&#x4E0D;&#x4F1A;&#x53D7;&#x8BBE;&#x7F6E;&#x5C5E;&#x6027;&#x7684;&#x5F71;&#x54CD;</li>
<li><code>:nth-child(n)</code>--&#x9009;&#x62E9;&#x5143;&#x7D20;&#x4E2D;&#x7684;&#x5176;&#x4E2D;&#x4E00;&#x4E2A;&#x5B50;&#x5143;&#x7D20;<code>2n&#x5076;&#x6570;</code> <code>2n+1&#x5947;&#x6570;</code></li>
<li>a&#x6807;&#x7B7E;&#x7684;&#x4F2A;&#x7C7B;&#x5C5E;&#x6027;:<ul>
<li><code>:link</code>--&#x672A;&#x8BBF;&#x95EE;&#x65F6;&#x7684;&#x72B6;&#x6001;</li>
<li><code>:visited</code>--&#x5DF2;&#x8BBF;&#x95EE;</li>
<li><code>:hover</code>--&#x60AC;&#x6D6E;</li>
<li><code>:active</code>--&#x5DF2;&#x6FC0;&#x6D3B;&#x72B6;&#x6001;<h5 id="lvha-&#x987A;&#x5E8F;&#x4E0D;&#x80FD;&#x53D8;">lvha &#x987A;&#x5E8F;&#x4E0D;&#x80FD;&#x53D8;</h5>
</li>
</ul>
</li>
</ul>
<h3 id="&#x4F2A;&#x5BF9;&#x8C61;&#x5047;&#x7684;html&#x6807;&#x7B7E;">&#x4F2A;&#x5BF9;&#x8C61;--&#x5047;&#x7684;html&#x6807;&#x7B7E;</h3>
<ul>
<li><code>::after</code></li>
<li><code>::before</code></li>
</ul>
<h3 id="&#x5C5E;&#x6027;&#x9009;&#x62E9;&#x5668;">&#x5C5E;&#x6027;&#x9009;&#x62E9;&#x5668;</h3>
<ul>
<li><code>input[type=&quot;text&quot;]</code></li>
</ul>
<h3 id="&#x6743;&#x91CD;&#x95EE;&#x9898;">&#x6743;&#x91CD;&#x95EE;&#x9898;</h3>
<ul>
<li>&#x5F53;&#x9009;&#x62E9;&#x5668;&#x5199;&#x7684;&#x8D8A;&#x8BE6;&#x7EC6;&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x6743;&#x91CD;&#x8D8A;&#x5927;</li>
</ul>

                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../../md/02css/index.html" class="navigation navigation-prev " aria-label="Previous page: css"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../../md/02css/element_center.html" class="navigation navigation-next " aria-label="Next page: 元素垂直居中的方法"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../../gitbook/app.js"></script>

    
    <script src="../../gitbook/plugins/gitbook-plugin-toggle-chapters/toggle.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"image-captions":{"attributes":{"style":"left: 50%;position: relative;transform: translateX(-50%);"},"caption":"图 _PAGE_LEVEL_._PAGE_IMAGE_NUMBER_ - _CAPTION_","align":"center","variable_name":"_pictures"},"fontsettings":{"theme":"night","family":"sans","size":2},"toggle-chapters":{},"highlight":{}};
    gitbook.start(config);
});
</script>

        <!-- body:end -->
    </body>
    <!-- End of book 我的电子书 -->
</html>
